public class ChronologyModel extends Object implements XMLMarshallable
Java class defines a chronology that includes a list of period objects.The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="chronology">
<xs:complexType>
<xs:sequence>
<xs:element ref="period" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
| Constructor and Description |
|---|
ChronologyModel()
Constructs an empty
ChronologyModel |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(String cData)
Adds character data to the content element.
|
void |
addChild(String name,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
XMLMarshallable |
get(Date d)
Returns the valid element at the specified date, or
null
if there is no valid element. |
PeriodObjectModel |
getPeriod(Date d)
Returns the valid period at the specified date, or
null
if there is no valid period. |
Vector<PeriodObjectModel> |
getPeriods()
Provides the list of the periods in this chronology
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
public XMLMarshallable get(Date d)
null
if there is no valid element.d - The date for which a valid element is to be retrievedelement valid at the specified date, or null
if no such element existspublic PeriodObjectModel getPeriod(Date d)
null
if there is no valid period.d - The date for which a valid period is to be retrievednull
if no such element existspublic Vector<PeriodObjectModel> getPeriods()
periods included in this chronologyPeriodObjectModelpublic void setAttributes(XMLAttributes atts)
XMLMarshallablesetAttributes in interface XMLMarshallableatts - The XML attributes of the current elementpublic void addChild(String name, XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.addChild in interface XMLMarshallablename - The name of tag for the childchild - The child to be addedpublic void addCharacterData(String cData)
XMLMarshallableaddCharacterData in interface XMLMarshallablecData - The character data to be addedpublic void marshal(XMLOutputter output)
XMLMarshallablemarshal in interface XMLMarshallableoutput - The XML output to marshal the object into